package com.wanmait.meteor.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wanmait.meteor.mapper.MeetinfoMapper;
import com.wanmait.meteor.pojo.Meetinfo;
import com.wanmait.meteor.service.MeetinfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class MeetinfoServiceImpl implements MeetinfoService {
    @Resource
    private MeetinfoMapper meetinfoMapper;

    @Override
    public void insert(Meetinfo meetinfo) {

    }

    @Override
    public List<Meetinfo> findAll() {

        return meetinfoMapper.findAll();
    }

    @Override
    public void update(Meetinfo meetinfo) {

    }

    @Override
    public PageInfo<Meetinfo> findAll(Meetinfo meetinfo,int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Meetinfo> Meetinfos = meetinfoMapper.list(meetinfo);
        PageInfo<Meetinfo> pageInfo = new PageInfo<>(Meetinfos);
        return pageInfo;
    }

    @Override
    public PageInfo<Meetinfo> selectList(Meetinfo meetinfo, int pageNum, int pageSize ) {
        PageHelper.startPage(pageNum,pageSize);
        List<Meetinfo> meetinfos=meetinfoMapper.selectList(meetinfo);
        PageInfo<Meetinfo> pageInfo=new PageInfo<>(meetinfos);
        return pageInfo;
    }

    @Override
    public void delMeetinfo(Integer id) {
        meetinfoMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void changeAudit(Integer id) {
        meetinfoMapper.changeAudit(id);
    }

    @Override
    public void changeSuffing(Integer id) {
        meetinfoMapper.changeSuffing(id);
    }

    @Override
    public Meetinfo selectAMeet(Integer id) {
        return meetinfoMapper.selectAMeet(id);
    }

    @Override
    public Meetinfo selectAMeetinfo(Integer id) {
        return meetinfoMapper.selectAMeetinfo(id);
    }

}
